// 发请求，获取分类数据；渲染页面
async function getNavList(){
    let result = await axios.get("http://127.0.0.1:3000/article/cate_list");
    var data = result.data.result || [];
    // console.log(result.data,data)
    //<li class=""><a href="category.html">面向对象</a></li>
    var ul = document.querySelector(".menu");
    var str="";
    data.forEach( ( val,index )=> {
        // category.html?id=1
        str+=`<li class=""><a href="category.html?id=${val.id}">${val.cate_name}</a></li>`;
    })
    ul.innerHTML=str;
}
getNavList();